#define	inet_to_stringSize	(4 + 4 + 4 + 5 + 1)

extern char *inet_to_char(struct in_addr ip, char *out);

inline string	port_to_string(u_int16_t port) {
	char	buf[32];
	sprintf(buf, "%u", port);
	return string(buf);
}

inline string	protocol_to_string(u_int8_t proto) {
	char	buf[32];
	sprintf(buf, "%u", (unsigned int)proto);
	return string(buf);
}

inline ostream& operator<<(ostream &os, struct in_addr ip) {
	char	ip_char[inet_to_stringSize];
	inet_to_char(ip, ip_char);
	os << ip_char;
	return os;
}

